﻿(function ($) {
    $.popMenu = function (message, options) {
        message = $.extend({}, $.popMenu.message, message);
        options = $.extend({}, $.popMenu.options, options);
        //$(document.body).click(function () { $(document.body).find("#popMenu").empty(); });
        $(document.body).find("#popMenu").empty();

        var msgbox = $("<div></div>");
        msgbox.attr("id", "popMenu");
        msgbox.css({ "position": "absolute", "left": options.left, "top": options.top, "z-index": "999", "width": "300px", "height": "200px;", display: "block" });
        msgbox.css(options.css);

        if (options.showTitle) {
            var title = $("<div></div>");
            title.css({ "height": "30px" });
            title.text(message.title);
            msgbox.append(title);
        }


        msgbox.text(message.message);
        $(document.body).append(msgbox);

    }
    $.popMenu.message = { title: "this is title", message: "this is message" }
    $.popMenu.options = { showTitle: true, left: 0, top: 0, css: {}, name: "popmsg" }




})(jQuery);